package com.homework.ab_if.test1;

public class Rectangle extends Shape {
  int width, height;

  @Override
  void getArea() {
    System.out.println("面积为：" + (width * height));
  }

  @Override
  void getPer() {
    System.out.println("周长为：" + ((width + height) * 2));
  }

  @Override
  void showAll() {
    getArea();
    getPer();
    getColor();
  }

  @Override
  void getColor() {
    super.getColor();
  }

  public Rectangle(int area, int per, String color, int width, int height) {
    super(area, per, color);
    this.width = width;
    this.height = height;
  }

  public Rectangle(String color, int width, int height) {
    super(color);
    this.width = width;
    this.height = height;
  }
}
